<%@ page pageEncoding="UTF-8" contentType="text/html;charset=utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<%@ include file="/common/taglibs.jsp"%>
<head>
<title><s:text name="webapp.name" /></title>
<%@ include file="/common/meta.jsp"%>
</head>
<body>
	<s:form action="userRole_save" method="post" validate="true" theme="simple">
		<%@ include file="/common/header.jsp"%> 
		<!----------- 编辑栏 -------------------->
		<s:if test="user.password != null">   
		<table class="ow_fim_mg" style="margin-top:5px;" cellspacing="1" cellpadding="3">  
			<tr>
				<td class="ow_fim_l" width="90">
				    <s:text name="user.username" /> <s:text name="colon" /> 
				</td>
				<td class="ow_fim_r"> 
					<s:if test="user.username == null">
					   <s:textfield name="user.username" />
					</s:if>
				    <s:else>
					   <s:textfield name="user.username" readonly="true" />
				    </s:else>
				    <s:hidden name="user.id" />
				    <s:hidden name="user.organization" />
				</td>  
			</tr>
            <tr>
				<td class="ow_fim_l">
					<s:text name="user.password" /> <s:text name="colon" />
				</td>
				<td class="ow_fim_r">
					<s:if test="user.password == null">
					     <s:password name="user.password"></s:password>
				    </s:if>
				    <s:else>
				    	<s:hidden name="user.password" />
				    	<input type="text" name="password" readonly="readonly" value="******" />
					</s:else>
				</td>
			</tr> 
			<tr style="display:none;">
				<td class="ow_fim_l">
					<s:text name="user.status" /> <s:text name="colon" />
				</td>
				<td class="ow_fim_r">
					<s:textfield name="user.status" readonly="true" />
				</td>
			</tr>   
			<tr>
				<td class="ow_fim_l">
					<s:text name="user.name" /><s:text name="colon" /> 
				</td>
				<td class="ow_fim_r">
					<s:textfield name="user.name" />
				</td>
			</tr>
			<tr>
				<td class="ow_fim_l">
					税务机关<s:text name="colon" /> 
				</td>
				<td class="ow_fim_r">
					<s:textfield name="user.fj" />
				</td>
			</tr>			
			<tr>
				<td class="ow_fim_l">
					<s:text name="user.role" /><s:text name="colon" /> 
				</td>
				<td class="ow_fim_r"> 
					<table border="0" cellspacing="1" cellpadding="0">
						<tr>
							<th align="center"><input type="checkbox" id="chooseAll" /></th>
							<th align="left" width="200px"><s:text name="role.title" /></th>
						</tr>  
						<s:iterator value="roleList">
						<tr>
							<td align="center">
								<s:if test="checked">
									<input type="checkbox" name="ids" value="${id}" checked="checked" />
								</s:if> 
								<s:else>
									<input type="checkbox" name="ids" value="${id}" />
								</s:else>
							</td>
							<td align="left">${name}</td>
						</tr>
						</s:iterator>
					</table>
				</td>
			</tr>
			<tr>
				<td class="rtm_shb_r">
					
				</td>
				<td class="rtm_shb_r" align="right"> 
				    <s:submit key="button.save"></s:submit> 
				    <s:submit action="userRole_input" key="button.cancel" onclick="form.onsubmit=null"></s:submit> 
				</td> 
			</tr>			
		</table>
		</s:if>
        <!----------- 数据列表 ------------------>
       	<table width="100%" border="0"  width="*" cellpadding="0" cellspacing="1" class="dg_borderstyle">
		    <tr>  
		    	<td class="dg_headerstyle"><s:text name="user.username" /></td>
				<td class="dg_headerstyle"><s:text name="user.name" /></td>				
				<td class="dg_headerstyle"><s:text name="user.status" /></td>
				<td class="dg_headerstyle">税务机关</td>
				<!--
				<td class="dg_headerstyle"><s:text name="base.dateCreate" /></td>
				<td class="dg_headerstyle"><s:text name="base.dateUpdate" /></td>
				-->
				<td  class="dg_headerstyle"><s:text name="button.ctrl" /></td>
			</tr> 
			<s:iterator value="userList">
			<tr class="dg_alternatingitemstyle">
				<td align="left">${username}</td>
				<td align="left"><a href="${ctx}/userRole_list?user.id=${id}">${name}</a></td>
				<td align="center">${status}</td>
				<td align="center">${fj}</td>
				<!-- 
				<td align="center">${organization}</td>
				<td align="center">${dateUpdate}</td>
				 -->
				<td align="center"><a href="${ctx}/userRole_list?user.id=${id}"><s:text name="button.modify" /></a></td>
			</tr>
			</s:iterator>
	    </table> 		
		<%@ include file="/common/footer.jsp"%>
	</s:form>
</body>
</html>
